package com.sloera.jvm.gc;

/**
 * @author sloera
 * @create 2020/5/3
 */
public class HelloGC {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("************");
        Runtime runtime = Runtime.getRuntime();
        int availableProcessors = runtime.availableProcessors();
        System.out.println("处理器数量:" + availableProcessors);
        //Java虚拟机中的初始内存总量
        long totalMemory = runtime.totalMemory();
        System.out.println("TOTAL_MEMORY(-Xms) = " + (totalMemory / 1024 / 1024) + "MB");
        //Java虚拟机最大内存量
        long maxMemory = runtime.maxMemory();
        System.out.println("MAX_MEMORY(-Xmx) = " + (maxMemory / 1024 / 1024) + "MB");

        byte[] bytes = new byte[20 * 1024 * 1024];
        //Thread.sleep(Integer.MAX_VALUE);
    }
}